<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="../../assets/css/base.css">
  <style>
    div>div {
      width: 500px;
      height: 500px;
      background-color: rgba(17, 119, 255, 0.5);
      background-image: url(../../assets/images/Ereshkigal.jpg);
      background-position: center;
      background-repeat: no-repeat;
    }

    .fixed {
      /* 固定值 */
      background-size: 300px 400px;
    }

    .percentage {
      /* 当前元素大小的百分比 */
      background-size: 100% 100%;
    }

    .contain {
      background-size: contain;
    }

    .cover {
      background-size: cover;
    }
  </style>
</head>

<body>
  <div class="float-left margin-left-10">
    <p class="title">固定值</p>
    <div class="fixed"></div>
  </div>

  <div class="float-left margin-left-10">
    <p class="title">当前元素大小的百分比</p>
    <div class="percentage"></div>
  </div>

  <div class="float-left margin-left-10">
    <p class="title">contain</p>
    <div class="contain"></div>
  </div>

  <div class="float-left margin-left-10">
    <p class="title">cover</p>
    <div class="cover"></div>
  </div>
</body>

</html>